﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExemploGridCompleta.aspx.cs" Inherits="Exemplos.Web.ExemploGridCompleta" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Panel ID="Panel1" runat="server" GroupingText="Filtros">
            <asp:Label ID="Label1" runat="server" Text="Nome: "></asp:Label>
            <asp:TextBox ID="txtNome" runat="server"></asp:TextBox>
            <br />
            <asp:Label ID="Label2" runat="server" Text="Área:   "></asp:Label>
            <asp:DropDownList ID="ddlArea" runat="server" DataSourceID="AreaDataSource" 
                DataTextField="Descricao" DataValueField="ID">
            </asp:DropDownList>
            <asp:EntityDataSource ID="AreaDataSource" runat="server" 
                ConnectionString="name=DBUCNEntities" DefaultContainerName="DBUCNEntities" 
                EnableFlattening="False" EntitySetName="TBAreas" EntityTypeFilter="TBArea">
            </asp:EntityDataSource>
            <br />
            <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar" 
                onclick="btnPesquisar_Click" />
        </asp:Panel>
    
    </div>
    <asp:Panel ID="Panel2" runat="server" GroupingText="Resultados">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="grvExemplo" runat="server" 
                    onrowediting="grvExemplo_RowEditing">
                    <Columns>
                        <asp:CommandField DeleteText="Excluir" EditText="Editar" ShowEditButton="True" 
                            UpdateText="Atualizar" />
                    </Columns>
                    <EmptyDataTemplate>
                        Nenhum dado encontrado.
                    </EmptyDataTemplate>
                </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnPesquisar" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </asp:Panel>
    </form>
</body>
</html>
